package com.actionpals.components.controls
{
	import com.actionpals.enum.InvalidationType;
	import com.actionpals.events.ComponentEvent;
	
	import flash.display.DisplayObject;
	import flash.events.Event;
	import flash.events.FocusEvent;
	import flash.events.KeyboardEvent;
	import flash.events.TextEvent;
	import flash.text.TextField;
	import flash.text.TextFieldType;
	import flash.text.TextFormat;
	import flash.text.TextLineMetrics;
	import flash.ui.Keyboard;

	public class TextInput extends BaseTextField
	{
		
		public function TextInput()
		{
			super();
		}
		
		public override function set editable( value:Boolean ):void
		{
			super.editable = value;
			updateTextFieldType();
		}
		
		public override function set enabled( value:Boolean ):void
		{
			super.enabled = value;
			updateTextFieldType();
		}
		
		
		protected override function focusInHandler( evt:FocusEvent ):void
		{
			super.focusInHandler( evt );
			if( editable )
			{
				if( field.selectable && field.selectionBeginIndex == field.selectionBeginIndex )
				{
					setSelection( 0, field.length );
				}
			}
		}
		
	}
}